#pragma once
#include "WLObject.h"
class WLArchive
{
	char *m_pBuffer;
	unsigned int m_BufferRead;
	WLArchive();
public:
	static char staticCharPool[1024];
	WLArchive(char* Buffer)
	{
		m_pBuffer = Buffer;
		m_BufferRead = 0;
	
	}
	const char* ParseToken(char *Str);
	
	WLArchive& operator << (int& DestInt )
	{
		DestInt = ::atoi(ParseToken(m_pBuffer+m_BufferRead));
		return *this;
	}
	WLArchive& operator << (float& DestFloat )
	{
		DestFloat = ::atof(ParseToken(m_pBuffer+m_BufferRead));
		return *this;
	}
	WLArchive& operator << (std::string& DestString )
	{
		DestString = ParseToken(m_pBuffer+m_BufferRead);
		return *this;
	}

	WLArchive& operator << (WLObject * DestObj )
	{
		DestObj->Serialize(*this);
		return *this;
	}

};

WLArchive& operator << (WLArchive& Ar, WLVector3& DestVector3 );
WLArchive& operator << (WLArchive& Ar, WLQuaternion& Quat );
